
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>后台权限管理系统</title>
		<link rel="stylesheet" href="css/login.css">
		<script src="js/global.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" href="res/layui/css/layui.css" media="all">
		<script src="res/layui/layui.js"></script>
	</head>

	<body class="login-bg">
		<canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
		<div class="login">
			<div class="message">权限管理系统登录</div>
			<div id="darkbannerwrap"></div>
			<form method="post" id="fmLogin" class="layui-form" onsubmit="return false;">
				<input type="hidden" name="token" id="loginToken" />
				<input name="loginNam" placeholder="用户名" id="loginNam" type="text" lay-verify="required" class="layui-input">
				<hr class="hr15">
				<input name="password" id="password"  lay-verify="required" placeholder="密码" type="password" class="layui-input">
				<hr class="hr15">
				<input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
				<hr class="hr20">
			</form>
		</div>
		<script>
			layui.use(['table', 'layer', 'laydate', 'form'], function() {
				var table = layui.table;
				var layer = layui.layer;
				var form = layui.form;
				var laydate = layui.laydate;
				var $ = layui.$ ;
			/* 	$("#loginToken").val(globalData.myToken); */
					//监听提交
					/* form.on('submit(login)',
						function(data) {
							$.post(globalData.server + "login", $("#fmLogin").serialize(), function(res) {
								if(res.success) {
									var obj = JSON.parse(res.message);
									//保存相关数据到本地缓存
									globalData.setUserInfo(obj.uid, $("#un").val(), obj.roleNames);
									//转向首页
									window.location.href = "back_index.html";
								} else {
									layer.msg('登录失败'+res.message, {
										icon: 1,
										time: 300
									});
								}
							}, "json");
							return false;
						}
					); */
						form.on('submit(login)', function(data) {
						var str = $("#fmLogin").serialize();
						$.post("carproduct/woqu", str, function(result) {
							if (result.code === '0') {
								layer.alert(result.msg);
								location.href = "back_index.html";
							} else if (result.code === '1') {
								layer.alert(result.msg);
							}
						}, "json");
						return false ;
					});
				});
		</script>

	</body>

</html>